import { createStore } from 'vuex'
import vuexPersistedstate from "vuex-persistedstate";

const state = {//定义要共享的变量
    token:"",
    user:{}
}
const mutations={//定义修改变量的方法
    setToken(state,token){
        state.token=token
    },
    setUser(state,user){
        state.user=user;
    }

}


export default createStore({
    state,
    mutations,
    plugins:[vuexPersistedstate()]
})
